package com.example.health;

import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;

@Component
public class MyHealthIndicator implements HealthIndicator {
    /**
     * 自定义的检查方法
     * Health.down() 异常
     * Health.up() 正常
     */
    @Override
    public Health health() {
        return Health.up().withDetail("key","value").build();
    }
}
